package com.dreamthen.controller;

import com.dreamthen.entity.User;
import com.dreamthen.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * @Author zengms
 * @Date 2023-10-22 10:28:21
 **/
@Controller
public class UserController {

    @Autowired
    @Qualifier(value = "myUserServiceImpl")
    private IUserService myUserService;

    @Resource
    private IUserService iUserService;


    public User getUser(String id) {
        return myUserService.getUser(id);
    }

    public User getUserInfo(String id) {
        return iUserService.getUser(id);
    }

    @Autowired
    public void createUserService2(IUserService iUserService) {
        this.iUserService = iUserService;
    }

    @Autowired
    public void createUserService(@Qualifier("userServiceImpl") IUserService iUserService) {
        this.iUserService = iUserService;
    }
}
